﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="user_view.aspx.cs" Inherits="Template.Web.Admin.user_view" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
    <!-- Bootstrap core CSS -->
    <link href="../css/bootstrap.min.css" rel="stylesheet" />
    <link href="../css/bootstrap-reset.css" rel="stylesheet" />
    <!--external css-->
    <link href="../assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="../css/style.css" rel="stylesheet" />
    <link href="../css/style-responsive.css" rel="stylesheet" />
    <link href="../assets/toastr-master/toastr.css" rel="stylesheet" />
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]><script src="../js/html5shiv.js"></script><script src="../js/respond.min.js"></script><![endif]-->
</head>
<body>
    <section class="wrapper site-min-height">
        <!-- page start-->
        <div class="col-xs-12">
            <section class="panel panel-primary">
                <header class="panel-heading"><i class="fa fa-search"></i>用户信息详情</header>
                <div class="panel-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-body">
                            <!--/row-->
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">用户姓名:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="userName"></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">年龄:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="age"></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/row-->
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">邮箱:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="email"></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">手机号码:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="mobile"></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/row-->
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">身份证号:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="idCard"></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">头像:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="head"></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/row-->
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">生日:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="birthday"></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">备注:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static" id="remark"></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/row-->
                            <div class="row"></div>
                        </div>
                        <div class="form-actions">
                            <div class="row">
                                <div class="col-md-offset-4 col-md-8">
                                    <button id="btnModify" type="button" class="btn btn-info"><i class="fa fa fa-pencil-square-o"></i>编辑</button>
                                    <button id="btnReturn" type="button" class="btn btn-warning"><i class="fa fa-reply"></i>返回</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </section>
        </div>
        <!-- page end-->
    </section>
    <!-- js placed at the end of the document so the pages load faster -->
    <script src="/js/jquery.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/assets/toastr-master/toastr.js"></script>
    <!-- 按需加载 -->
    <script type="text/javascript" src="/scripts/util/myUtil2.js"></script>
    <script type="text/javascript" src="/scripts/myJsPlugin/viewPlugin.js"></script>

    <script>
        $(document).ready(function () {
            'use strict';
            // 配置插件
            var myViewPlugin = new ViewPlugin({
                // 处理程序url
                handlerUrl: 'handler/userHandler.ashx',
                // 返回页面url
                returnPageUrl: 'user_list.aspx?state=has',
                // 获取详情额外参数
                viewParams: {
                    action: 'detail',
                    id: myUtil.getUrlParam('id')
                },
                // 页面控件
                pageControls: [
                    {
                        controlID: '#userName',
                        // 赋值需要特殊处理的，添加reset属性，element指这个$('#userName')对象，value是值
                        reset: function (element, value) {
                            var renderHtml = '<span class="danger">' + value + '</span>';
                            return renderHtml;
                        }
                    },
                    {
                        controlID: '#age'
                    },
                    {
                        controlID: '#email'
                    },
                    {
                        controlID: '#mobile'
                    },
                    {
                        controlID: '#idCard'
                    },
                    {
                        controlID: '#head'
                    },
                    {
                        controlID: '#birthday'
                    },
                    {
                        controlID: '#remark'
                    }
                ]
            });

            // 重写单击事件绑定(默认有返回按钮事件)
            //myViewPlugin.bindClickEvent = function () {
            //    $('#btnReturn').on('click', function () {
            //        window.self.location.href = 'user_list.aspx?state=has';
            //    });
            //};

            // 初始化插件
            myViewPlugin.init();
        });
    </script>
</body>
</html>

